<?php

$data = array (
	0 =>  array('1','Lada Priora', '10000'),
	1 =>  array('2','Toyota Auris', '30000'),
	2 =>  array('3','Mersedes SL', '100000'),
	4 =>  array('4','Opel Astra', '20000'),
	5 =>  array('5','Toyota Camry', '58000'),
	6 =>  array('6','Taureg', '150000'),
	7 =>  array('7','Lada Priora', '10000'),
	8 =>  array('8','Toyota Auris', '30000'),
	9 =>  array('9','Mersedes SL', '100000'),
	10 =>  array('10','Opel Astra', '20000'),
	11 =>  array('11','Toyota Camry', '58000'),
	12 =>  array('12','Taureg', '150000'),
	13 =>  array('13','Taureg', '150000'),
	14 =>  array('14','Lada Priora', '10000'),
	15 =>  array('15','Toyota Auris', '30000'),
	16 =>  array('16','Mersedes SL', '100000'),
	17 =>  array('17','Opel Astra', '20000'),
	18 =>  array('18','Toyota Camry', '58000'),
	19 =>  array('19','Taureg', '150000'),
	20 =>  array('20','Lada Priora', '10000'),
	21 =>  array('21','Toyota Auris', '30000'),
	22 =>  array('22','Mersedes SL', '100000'),
);

$page = $_REQUEST['page'];
$rows = $_REQUEST['rows'];

$offset = $page * $rows - $rows;

$response['items'] = array_slice($data, $offset, $rows, true);
$response['total'] = count($data);

echo json_encode($response);




